Hệ thống quản lý ISP trong PHP
1 <?php
2 require_once "includes/headx.php";
3 if (!isset($_SESSION['admin_session']) )
4 {
5 $commons->redirectTo(SITE_PATH.'login.php');
6 }
7 require_once "includes/classes/admin-class.php";
8 $admins = new Admins($dbh);
9 $id = isset($_GET[ 'customer' ])?$_GET[ 'customer' ]:'';
10 ?>
11 <!doctype html>
12 <html lang="en" class="no-js">
13 <head>
14 <meta charset=" utf-8">
15 <meta name="viewport" content="width=device-width, initial-scale=1">
16 <link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,700' rel='stylesheet' type='text/css'>
17 <link rel="stylesheet" href="component/css/bootstrap.css"> <!-- CSS bootstrap -->
18 <link rel="stylesheet" href="component/css/bootstrap-select.min.css"> <!-- CSS bootstrap -->
19 <link rel="stylesheet" href="component/css/style.css"> <!-- Resource style -->
20 <link rel="stylesheet" href="component/css/reset.css"> <!-- Resource style -->
21 <link rel="stylesheet" href="component/css/invoice.css"> <!-- CSS bootstrap -->
22 <script src="component/js/modernizr.js"></script> <!-- Modernizr -->
23 <title>Invoice | Netway</title>
24 </head>
25 <body>
26 <div class="container">
27 <?php
28 $info = $admins->getCustomerInfo($id);
29 if (isset($info) && sizeof($info) > 0) {
30 $package_id = $info->package_id;
31 $packageInfo = $admins->getPackageInfo($package_id);
32 ?>
33 <div class="row">
34 <div class="brand"><img src="component/img/logo.png" alt=""></div>
35 <div class="pull-right">Date: <?=date("jS F y")?></div><br>
36 <div class="em"><b>Name : </b> <em><?=$info->full_name?></em></div>
37 <div class="em"><b>Address:</b> <em><?=$info->address ?></em></div>
38 <div class="em"><b>Contact :</b> <em><?=$info->contact ?></em> </div>
39 <div class="em"><b>Package:</b> <em><?=$packageInfo->name?></em> </div>
40 <div class="em"><b>IP address:</b> <em><?=$info->ip_address?></em></div>
41 <span class="message pull-right">Last payment date : <?=date("jS F y",strtotime("+7 day"))?></span>
42 </div>
43 <?php } ?>
44 <div class="row">
45 <table class="table table-striped table-bordered">
46 <thead class="thead-inverse">
47 <tr>
48 <th>SL </th>
49 <th>Month</th>
50 <th>Amount</th>
51 </tr>
52 </thead>
53 <tbody>
54 <?php
55 $bills = $admins->fetchindIvidualBill($id);
56 $total = 0;
57 if (isset($bills) && sizeof($bills) > 0){
58 foreach ($bills as $bill){
59 $total += $bill->amount;
60 $monthArray[]=$bill->r_month;
61 $bill_ids[]=$bill->id;
62 ?>
63 <tr>
64 <td><?=$bill->id?></td>
65 <td><?=$bill->r_month?></td>
66 <td><?=$bill->amount?></td>
67 </tr>
68 <?php } ?>
69 </tbody>
70 <tfoot>
71 <tr>
72 <th colspan="2"> Net Total</th>
73 <th><?=$total?></th>
74 </tr>
75 <tr>
76 <th>In Words</td>
77 <th colspan="2"><?=getToText($total)?> Only.</th>
78 </tr>
79 </tfoot>
80 <?php
81 } ?>
82 </table>
83 </div>
84 <div class="row">
85 <form class="form-inline" action="post_approve.php" method="POST">
86 <input type="hidden" name="customer" value="<?=$info->id?>">
87 <input type="hidden" name="bills" value="<?=implode($bill_ids,',')?>">
88 <div class="form-group">
89 <label for="months"></label>
90 <select class="selectpicker" name="months[]" id="months" multiple required title="Select months">
91 <?php
92 if (isset($monthArray) && sizeof($monthArray) > 0){
93 foreach ($monthArray as $month) {
94 echo '<option value="'.$month.'">'.$month.'</option>';
95 }}
96 ?>
97 </select>
98 </div>
99 <div class="form-group">
100 <label class="sr-only" for="discount">Discount</label>
101 <input type="number" class="form-control" name="discount" id="discount" placeholder="Discount" >
102 </div>
103 <div class="form-group">
104 <label class="sr-only" for="total">Payment</label>
105 <input type="number" class="form-control disabled" name="total" id="total" placeholder="total" required="" value="<?=$total?>">
106 </div>
107 <button type="submit" class="btn btn-primary">Paid</button>
108 </form>
109 </div>
110 <div class="sign pull-right">Authorized Signature</div>
111 </div>
112 </body>
113 <?php include 'includes/footer.php'; ?>
114 <script src="component/js/bootstrap-select.min.js"></script>
115 <script>
116 $('#months').on('changed.bs.select', function (e) {
117 console.log(this.value);
118 });
119 </script>